cmake_minimum_required(VERSION 3.19)
project(cvcudaImpl)

include(cmake/Config.cmake)  # global Config
include(cmake/CvCudaImplUtils.cmake)  # global utils

# set constant
set(CMAKE_CXX_STANDARD 14)  # cplus version
set(CMAKE_VERBOSE_MAKEFILE ON)  # output makefile
set(CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/install)  # set file install path
set(CMAKE_PREFIX_PATH ${CMAKE_CURRENT_BINARY_DIR}/install)  # set to find self package
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)  # set build lib with rpath, then we can the target properties

# add compile
set(CMAKE_CXX_FLAGS_DEBUG -g)
set(CMAKE_CUDA_FLAGS_DEBUG "-g -G")

# build application config
set(SOURCE_LIST Config/ApplicationConfig.h Config/ApplicationConfig.cpp)
set(SOURCE_DIR Config)
set(PUBLIC_HEADER Config/ApplicationConfig.h)
set(BUILD_FOR_PY OFF)
include_directories(Config)  # 共享ApplicationConfig.h
SegModuleBuild(${PROJECT_NAME} "${SOURCE_LIST}" "${SOURCE_DIR}" "${PUBLIC_HEADER}" ${BUILD_FOR_PY} ON OFF)

# ask cmake to build sub module
add_subdirectory(CPlusCVDemo)
#add_subdirectory(CvCudaCommon)
#add_subdirectory(SegSystem)
#add_subdirectory(test)